<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\modules\home\models\OrderSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Orders';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="order-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <span class="btn btn-info"><?=$money?></span>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\ActionColumn'],

            'id',
            'uid',
            'out_trade_no',
            'pay_type',
            'transaction_id',
            //'subject',
            'total_amount',
            //'remark',
            //'callback',
            [
                'format' => 'raw',
                'attribute' => 'status',
                'value' => function($model) {

                    if($model->status == 'payed'){
                        return '<span class="btn btn-xs btn-success">已付款</span>';
                    }else{
                        return '<span class="btn btn-xs btn-danger">未付款</span>';
                    }

                },
                'filter' => ['unpay' => '未付款', 'payed' => '已付款'],
            ],
            //'date',
            //'create_at',
            //'update_at',


        ],
    ]); ?>
</div>
